from main.model.devices.cpu import CPU

class CPUWrapper(CPU):
    
    def __init__(self, os_usher, listener=None):
        CPU.__init__(self, os_usher)
        self.__listeners = []
        if(listener): self.add(listener)
        self.__run_event = object()
            
    def add(self, listener):
        self.__listeners.append(listener)
        
    def run(self):
        for listener in self.__listeners:
            listener.append(self.__run_event)
        CPU.run(self)
            
    @property
    def run_event(self):
        return self.__run_event
    
    
    
    